package com.situ.controller;

import com.situ.pojo.Food;
import com.situ.service.FoodService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import java.util.*;

@Controller
public class FoodController {
    @Autowired
    FoodService service;

    @GetMapping("showfoods")
    public String queryAll(Map map){

        List<Food> list=service.queryall();
        map.put("list", list);

        return "index.html";
    }
    @GetMapping("food-update1")
    public String update1(int id,Map map){
       Food food= service.queryById(id);
       map.put("food", food);
       return "update.html";
    }
    public String show(){
        return null;
    }
}
